#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <string>

using namespace std;

bool isRun(int year) {
    if (year % 100 == 0) {
        if (year % 4 == 0) {
            return 1;
        }
        return 0;
    }
    if (year % 4 == 0) {
        return 1;
    }
    return 0;
}

int dayOfyear(string date) {
    int year = atoi(date.substr(0, 4).c_str());
    int month = atoi(date.substr(5, 2).c_str());
    int day = atoi(date.substr(8, 2).c_str());

    int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int ans = 0;

    for (int i = 1; i < month; i++) {
        ans += days[i];
    }

    ans += day;

    if (month > 2 && isRun(year)) {
        ans += 1;
    }

    return ans;
}

int main() {
    return 0;
}
